import React from "react";
import { useLocation, useNavigate } from "react-router-dom";
import "./backprev.less";
const navs = ["/home", "/fast", "/mine"];
export default function Backprev() {
  const nav = useNavigate();
  const { pathname } = useLocation();
  return (
    <div
      className="back-prev"
      onClick={() => nav(-1)}
      style={{ display: navs.includes(pathname) ? "none" : "block" }}
    >
      返回上一页
    </div>
  );
}
